home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 January - Disc 2 / Macworld (1999-01) (Disk 2).dmg / Serious Demos / Symbolic Composer 4.2 / Environment / Projects / Questions & Answers / Q&A Programming Functions / Critisizing obvious material < prev    next >
Encoding:
Text File  |  1998-10-26  |  1.3 KB  |  35 lines  |  [TEXT/ScoM]

  1. CRITISIZING OBVIOUS MATERIAL
  2.  
  3. If a vector sounds boring smash it with vector-critisize. Like music 
  4. critics it is not very truthful but if a concert was bad the article 
  5. is still readable. Self-critical sets are a branch of mathematics. This
  6. set is critical to its minimum value. Originally the critical value
  7. is replaced by random number but it is much more interesting to use
  8. values of meaning and structures. If you supply random-fills from 
  9. vector-rounded gen-noise-white you'll get the original functionality.
  10. Try changing critic rule.
  11.  
  12. (defun vector-critisize (iter initial-set random-fills)
  13.   (let ((out initial-set)
  14.         (minval nil)
  15.         (fill-len (length random-fills))
  16.         (new-random nil))
  17.     (dotimes (i iter)
  18.       (setq minval (apply 'min (vector-to-list out))) 
  19.       (setq new-random (aref random-fills (mod i fill-len)))
  20.       (setq out (substitute new-random minval out :count 1)))
  21.     out))
  22.  
  23. (setq samples 512)
  24.  
  25. (setq v1 (vector-critisize 
  26.           samples
  27.           (vector-round 0 100 (gen-sin 1 1 samples))
  28.           (vector-round 0 100 (gen-sin 2 1 samples))))
  29. (setq v2 (vector-critisize 
  30.           samples
  31.           (vector-round 0 100 (gen-sin 3 1 samples))
  32.           (vector-round 0 100 (gen-sin 4 1 samples))))
  33.  
  34. (setq theme-vector1 (vector-critisize samples v1 v2))
  35.